package com.googlecode.lookie.platform.prefs;

import java.awt.GridBagLayout;
import javax.swing.JPanel;
import javax.swing.JLabel;
import java.awt.GridBagConstraints;
import javax.swing.JComboBox;
import java.awt.Insets;

public class LookAndFeelPreferencePanel
    extends JPanel
{

    private static final long serialVersionUID = 1L;

    private JLabel lookAndFeelComboBoxLabel = null;

    private JComboBox lookAndFeelComboBox = null;

    /**
     * This is the default constructor
     */
    public LookAndFeelPreferencePanel()
    {
        super();
        initialize();
    }

    public LookAndFeelPreferencePanel( LookAndFeelPreferencePanelParams params )
    {
        super();
        lookAndFeelComboBox = params.getLookAndFeelComboBox();
        lookAndFeelComboBoxLabel = params.getLookAndFeelComboBoxLabel();
        initialize();
    }

    /**
     * This method initializes this
     *
     * @return void
     */
    private void initialize()
    {
        GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
        gridBagConstraints1.fill = GridBagConstraints.HORIZONTAL;
        gridBagConstraints1.gridy = 0;
        gridBagConstraints1.weightx = 1.0;
        gridBagConstraints1.insets = new Insets( 3, 3, 3, 3 );
        gridBagConstraints1.gridx = 1;
        GridBagConstraints gridBagConstraints = new GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.insets = new Insets( 3, 3, 3, 3 );
        gridBagConstraints.fill = GridBagConstraints.NONE;
        gridBagConstraints.anchor = GridBagConstraints.WEST;
        gridBagConstraints.gridy = 0;
        this.setSize( 300, 200 );
        this.setLayout( new GridBagLayout() );
        this.add( getLookAndFeelComboboxLabel(), gridBagConstraints );
        this.add( getLookAndFeelComboBox(), gridBagConstraints1 );
    }

    /**
     * This method initializes lookAndFeelComboBox
     *
     * @return javax.swing.JComboBox
     */
    private JComboBox getLookAndFeelComboBox()
    {
        if ( lookAndFeelComboBox == null )
        {
            lookAndFeelComboBox = new JComboBox();
        }
        return lookAndFeelComboBox;
    }

    private JLabel getLookAndFeelComboboxLabel()
    {
        if ( lookAndFeelComboBoxLabel == null )
        {
            lookAndFeelComboBoxLabel = new JLabel();
            lookAndFeelComboBoxLabel.setText( "JLabel" );
        }
        return lookAndFeelComboBoxLabel;
    }

}
